package com.xc.util;

import java.io.PrintWriter;
import java.io.StringWriter;

public class PrintException {
	public static void main(String[] args) {
		try{
			System.out.println(1/0);
		}catch(Exception e){
			System.out.println( e.getMessage());
			System.out.println( e.getLocalizedMessage());
			StringWriter sw = new StringWriter();
			PrintWriter pw = new PrintWriter(sw);
			e.printStackTrace(pw);
			pw.flush();
			sw.flush();
			System.out.println( sw.toString());
		}
	}
}
